<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/conn_db.php");?>
<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/Util.php");?>
<?php //DB Open

	$result = null;
	$db = new MyDB ( false );
	$db->err_report = true;

?>
<?php

	$util = new Util();

	$sid = $_GET['sid'];
	$page = $_GET['page'];
	$bConf = $_GET['bConf'];
	$condition = $_GET['condition'];
	$words = $_GET['words'];
	$pass = $_GET['pass'];
	$mode = $_GET['mode'];
	$flag = false;

	$addStr = "bConf=" . $bConf . "&menuBid=" . $menuBid . "&menuSid=" . $menuSid . "&condition=" . $condition . "&words=" . $words . "&page=" . $page  . "&category_sid=" . $category_sid; 

	if($pass){
		$sql = "SELECT * from tb_board_article WHERE article_sid=".$sid." ORDER BY article_sid DESC";
		$db->query ( $sql );
		$query = $db->result;
		$total = mysql_num_rows ($query);
		if($total>0){
			$root = mysql_fetch_object($query);

			if($pass==$root->article_pw) $flag = true;
		}

	if($flag){
		if ($mode=="m") echo "<script>window.opener.location.href='free01_w.php?sid=$sid&mode=modify&$addStr&flag=$flag';self.close();</script>";
		elseif ($mode=="d") echo "<script>if (confirm('삭제하시겠습니까?')) window.opener.location.href = '/admin/board/board_article_write_proc_free.php?sid=$sid&mode=delete&next=/free01.php&$addStr';self.close();</script>";
	}else echo "<script>alert('패스워드가 일치하지 않습니다.');</script>";
	}

?>
<?php //DB Close

	$db->close ();

?>
<? include "inc/inc_header.php" ?><!-- header -->
<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
	<table width="400" border="0" cellpadding="0" cellspacing="10" bgcolor="#696969">
	  <tr>
		<td height="180" align="center" bgcolor="#FFFFFF" style="padding:20 0 20 0"><table width="0" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td align="center" style="padding-bottom:20"><img src="img/ques/cont_img01.jpg" width="190" height="17"></td>
		  </tr>
		  <tr>
			<td align="center"><table width="0" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td><img src="img/ques/cont_img02.jpg" width="48" height="11"></td>
				<form name="write" enctype="multipart/form-data" method="get">
				<input type="hidden" name="condition" value="<?=$condition?>" />
				<input type="hidden" name="words" value="<?=$words?>" />
				<input type="hidden" name="bConf" value="<?=$bConf?>" />
				<input type="hidden" name="page" value="<?=$page?>" />
				<input type="hidden" name="sid" value="<?=$sid?>" />
				<input type="hidden" name="mode" value="<?=$mode?>" />

				<input type="hidden" name="category_sid" value="<?=$category_sid?>" />

				<td style="padding-right:8"><input name="pass" type="password" class="box01"></td>
				<td><input type="image" src="img/board/bt_ok02.gif" style="width:50px;height:22px;" ></td>
				</form>
			  </tr>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
	</table>
<? include "inc/inc_footer.php" ?><!-- footer -->

